home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / systems / mac / euro-oztex / EOT2.1#3.sea.bin / TeX-inputs / STY / amstex.sty < prev    next >
Text File  |  1995-01-04  |  58KB  |  1,693 lines

  1. %% 
  2. %% This is file `amstex.sty', generated 
  3. %% on <1995/1/4> with the docstrip utility (2.2i).
  4. %% 
  5. %% The original source files were:
  6. %% 
  7. %% amstex.dtx 
  8. %%% ====================================================================
  9. %%%  @LaTeX-file{
  10. %%%     filename  = "amstex.dtx",
  11. %%%     version   = "1.2beta",
  12. %%%     date      = "1994/12/22",
  13. %%%     time      = "15:32:53 EST",
  14. %%%     author    = "American Mathematical Society",
  15. %%%     copyright = "Copyright (C) 1994 American Mathematical Society,
  16. %%%                  all rights reserved.  Copying of this file is
  17. %%%                  authorized only if either:
  18. %%%                  (1) you make absolutely no changes to your copy,
  19. %%%                  including name; OR
  20. %%%                  (2) if you do make changes, you first rename it
  21. %%%                  to some other name.",
  22. %%%     address   = "American Mathematical Society,
  23. %%%                  Technical Support,
  24. %%%                  Electronic Products and Services,
  25. %%%                  P. O. Box 6248,
  26. %%%                  Providence, RI 02940,
  27. %%%                  USA",
  28. %%%     telephone = "401-455-4080 or (in the USA and Canada)
  29. %%%                  800-321-4AMS (321-4267)",
  30. %%%     FAX       = "401-331-3842",
  31. %%%     checksum  = "53612 3838 13409 134567",
  32. %%%     email     = "tech-support@math.ams.org (Internet)",
  33. %%%     codetable = "ISO/ASCII",
  34. %%%     keywords  = "latex, amslatex, ams-latex, math, amstex, ams-tex",
  35. %%%     supported = "yes",
  36. %%%     abstract  = "This is part of the AMS-\LaTeX{} distribution. It
  37. %%%                  provides a variety of extra mathematical features,
  38. %%%                  largely derived from AMS-\TeX{}.",
  39. %%%     docstring = "The checksum field above contains a CRC-16 checksum
  40. %%%                  as the first value, followed by the equivalent of
  41. %%%                  the standard UNIX wc (word count) utility output of
  42. %%%                  lines, words, and characters.  This is produced by
  43. %%%                  Robert Solovay's checksum utility.",
  44. %%%  }
  45. %%% ====================================================================
  46. \ProvidesPackage{amstex}[1994/10/27 v1.2beta AMS extra math features]
  47. \DeclareOption{noamsfonts}{%
  48.   \PassOptionsToPackage{noamsfonts}{amsfonts}}
  49. \DeclareOption{psamsfonts}{%
  50.   \PassOptionsToPackage{psamsfonts}{amsfonts}}
  51. \DeclareOption{intlimits}{\let\ilimits@\displaylimits}
  52. \DeclareOption{nointlimits}{\let\ilimits@\nolimits}
  53. \DeclareOption{sumlimits}{\let\slimits@\displaylimits}
  54. \DeclareOption{nosumlimits}{\let\slimits@\nolimits}
  55. \DeclareOption{namelimits}{\let\nlimits@\displaylimits}
  56. \DeclareOption{nonamelimits}{\let\nlimits@\nolimits}
  57. \newif\ifctagsplit@
  58. \newif\iftagsleft@
  59. \DeclareOption{leqno}{\tagsleft@true}
  60. \DeclareOption{reqno}{\tagsleft@false}
  61. \DeclareOption{centertags}{\ctagsplit@true}
  62. \DeclareOption{tbtags}{\ctagsplit@false}
  63. \newif\if@fleqn
  64.  
  65. \newskip\@mathmargin
  66. \@mathmargin\@centering
  67.  
  68. \DeclareOption{fleqn}{%
  69.     \@fleqntrue
  70.     \@mathmargin = -1sp
  71.     \AtBeginDocument{%
  72.         \ifdim\@mathmargin= -1sp
  73.             \@mathmargin\leftmargini
  74.         \fi
  75.     }%
  76. }
  77. \ExecuteOptions{nointlimits,sumlimits,namelimits}
  78. \ProcessOptions
  79. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  80. \RequirePackage{amstext}[1994/09/01]     % \text
  81. \RequirePackage{amsfonts}[1994/09/01]    % \newsymbol, msam, msbm, eufm
  82. \RequirePackage{amsbsy}[1994/09/01]      % \boldsymbol
  83. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  84. \def\AmSTeX{\protect\AmS-\protect\TeX{}}
  85. \def\AmS{{\protect\AmSfont
  86.   A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}
  87. \def\AmSfont{%
  88.   \usefont{OMS}{cmsy}{\if\@xp\@car\f@series\@nil bb\else m\fi}{n}}
  89. \def\prim@s{\prime\futurelet\@let@token\pr@m@s}
  90. \def\pr@m@s{%
  91.   \ifx\@let@token'\DN@##1{\prim@s}\else\let\next@\egroup\fi\next@}
  92. \let\@prime=\prime
  93. \renewcommand{\prime}{{\kern\z@\@prime}}
  94. \DeclareRobustCommand{\mspace}[3]{%
  95.   \ifmmode\mskip#1#2\else\kern#1#3\fi\relax}
  96. \renewcommand{\,}{\mspace+\thinmuskip{.1667em}}
  97. \let\thinspace\,
  98. \renewcommand{\!}{\mspace-\thinmuskip{.1667em}}
  99. \let\negthinspace\!
  100. \renewcommand{\:}{\mspace+\medmuskip{.2222em}}
  101. \let\medspace\:
  102. \newcommand{\negmedspace}{\mspace-\medmuskip{.2222em}}
  103. \renewcommand{\;}{\mspace+\thickmuskip{.2777em}}
  104. \let\thickspace\;
  105. \newcommand{\negthickspace}{\mspace-\thickmuskip{.2777em}}
  106. \def\implies{\DOTSB\;\Longrightarrow\;}
  107. \def\impliedby{\DOTSB\;\Longleftarrow\;}
  108. \begingroup \catcode`\"=12 % in case activated by a preceding package
  109. \gdef\And{\DOTSB\;\mathchar"3026 \;}
  110. \gdef\lvert{\delimiter"426A30C }
  111. \gdef\rvert{\delimiter"526A30C }
  112. \gdef\lVert{\delimiter"426B30D }
  113. \gdef\rVert{\delimiter"526B30D }
  114. \endgroup % restore "
  115. \DeclareRobustCommand{\frac}{\new@ifnextchar[{\frfrac{}}{\frfrac{}[]}}
  116. \def\frfrac#1[#2]#3#4{\def\next@{#2}%
  117.   \ifx\next@\@empty \def\next@{#1{#3\over#4}}%
  118.   \else \def\next@{#1{#3\above#2\relax#4}}%
  119.   \fi
  120.   \next@}
  121. \def\dfrac{\protect\frfrac\displaystyle[]}
  122. \def\tfrac{\protect\frfrac\textstyle[]}
  123. \DeclareRobustCommand{\binom}{\frbinom{}}
  124. \def\frbinom#1#2#3{#1{#2\atopwithdelims()#3}}
  125. \def\dbinom{\protect\frbinom\displaystyle}
  126. \def\tbinom{\protect\frbinom\textstyle}
  127. \def\colon{\nobreak\mskip2mu\mathpunct{}\nonscript
  128.   \mkern-\thinmuskip{:}\mskip6muplus1mu\relax}
  129. \DeclareMathSymbol{\coprod@}{\mathop}{largesymbols}{"60}
  130. \def\coprod{\DOTSB\coprod@\slimits@}
  131. \DeclareMathSymbol{\bigvee@}{\mathop}{largesymbols}{"57}
  132. \def\bigvee{\DOTSB\bigvee@\slimits@}
  133. \DeclareMathSymbol{\bigwedge@}{\mathop}{largesymbols}{"56}
  134. \def\bigwedge{\DOTSB\bigwedge@\slimits@}
  135. \DeclareMathSymbol{\biguplus@}{\mathop}{largesymbols}{"55}
  136. \def\biguplus{\DOTSB\biguplus@\slimits@}
  137. \DeclareMathSymbol{\bigcap@}{\mathop}{largesymbols}{"54}
  138. \def\bigcap{\DOTSB\bigcap@\slimits@}
  139. \DeclareMathSymbol{\bigcup@}{\mathop}{largesymbols}{"53}
  140. \def\bigcup{\DOTSB\bigcup@\slimits@}
  141. \DeclareMathSymbol{\prod@}{\mathop}{largesymbols}{"51}
  142. \def\prod{\DOTSB\prod@\slimits@}
  143. \DeclareMathSymbol{\sum@}{\mathop}{largesymbols}{"50}
  144. \def\sum{\DOTSB\sum@\slimits@}
  145. \DeclareMathSymbol{\bigotimes@}{\mathop}{largesymbols}{"4E}
  146. \def\bigotimes{\DOTSB\bigotimes@\slimits@}
  147. \DeclareMathSymbol{\bigoplus@}{\mathop}{largesymbols}{"4C}
  148. \def\bigoplus{\DOTSB\bigoplus@\slimits@}
  149. \DeclareMathSymbol{\bigodot@}{\mathop}{largesymbols}{"4A}
  150. \def\bigodot{\DOTSB\bigodot@\slimits@}
  151. \DeclareMathSymbol{\bigsqcup@}{\mathop}{largesymbols}{"46}
  152. \def\bigsqcup{\DOTSB\bigsqcup@\slimits@}
  153. \def\dddot#1{{\mathop{#1}\limits^{\vbox to-1.4\ex@{\kern-\tw@\ex@
  154.  \hbox{\normalfont ...}\vss}}}}
  155. \def\ddddot#1{{\mathop{#1}\limits^{\vbox to-1.4\ex@{\kern-\tw@\ex@
  156.  \hbox{\normalfont....}\vss}}}}
  157. \def~{\nobreakspace}
  158. \DeclareRobustCommand{\nobreakspace}{\unskip\nobreak\ \ignorespaces}
  159. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  160. \newif\if@display
  161. \everydisplay\expandafter{\the\everydisplay \@displaytrue}
  162. \def\int{\DOTSI\intop\ilimits@}
  163. \def\oint{\DOTSI\ointop\ilimits@}
  164. \def\intkern@{\mkern-6mu\mathchoice{\mkern-3mu}{}{}{}}
  165. \def\intdots@{\mathchoice{\@cdots}%
  166.  {{\cdotp}\mkern1.5mu{\cdotp}\mkern1.5mu{\cdotp}}%
  167.  {{\cdotp}\mkern1mu{\cdotp}\mkern1mu{\cdotp}}%
  168.  {{\cdotp}\mkern1mu{\cdotp}\mkern1mu{\cdotp}}}
  169.  
  170. \def\iint{\DOTSI\protect\ints@\tw@}
  171. \def\iiint{\DOTSI\protect\ints@\thr@@}
  172. \def\iiiint{\DOTSI\protect\ints@{4}}
  173. \def\idotsint{\DOTSI\protect\ints@\z@}
  174.  
  175. \def\ints@#1{%
  176.   \mkern-7mu\mathchoice{\mkern-2mu}{}{}{}%
  177.   \mathop{\mkern7mu\mathchoice{\mkern2mu}{}{}{}%
  178.     \intop\ifnum#1=\z@\intdots@
  179.     \else\intkern@\fi
  180.     \ifnum#1>\tw@\intop\intkern@\fi
  181.     \ifnum#1>\thr@@\intop\intkern@\fi
  182.     \intop
  183.   }\ilimits@
  184. }
  185. \def\nolimits@{%
  186.   \DN@{\nolimits\ifx\@let@token\limits\expandafter\@gobble\fi}%
  187.   \FN@\next@}
  188. \begingroup \catcode`\"=12
  189. \gdef\newmcodes@{\mathcode`\'39\mathcode`\*42\mathcode`\."613A%
  190.  \mathcode`\-45\mathcode`\/47\mathcode`\:"603A\relax}
  191. \endgroup
  192. \DeclareRobustCommand{\operatorname}{%
  193.   \@ifstar{\qopname\newmcodes@ n}%
  194.           {\qopname\newmcodes@{no}}}%
  195. \DeclareRobustCommand{\qopname}[3]{\mathop{#1\operator@font#3}%
  196.   \csname #2limits@\endcsname}
  197. \def\arccos{\qopname\relax{no}{arccos}}
  198. \def\arcsin{\qopname\relax{no}{arcsin}}
  199. \def\arctan{\qopname\relax{no}{arctan}}
  200. \def\arg{\qopname\relax{no}{arg}}
  201. \def\cos{\qopname\relax{no}{cos}}
  202. \def\cosh{\qopname\relax{no}{cosh}}
  203. \def\cot{\qopname\relax{no}{cot}}
  204. \def\coth{\qopname\relax{no}{coth}}
  205. \def\csc{\qopname\relax{no}{csc}}
  206. \def\deg{\qopname\relax{no}{deg}}
  207. \def\det{\qopname\relax n{det}}
  208. \def\dim{\qopname\relax{no}{dim}}
  209. \def\exp{\qopname\relax{no}{exp}}
  210. \def\gcd{\qopname\relax n{gcd}}
  211. \def\hom{\qopname\relax{no}{hom}}
  212. \def\inf{\qopname\relax n{inf}}
  213. \def\injlim{\qopname\relax n{inj\,lim}}
  214. \def\ker{\qopname\relax{no}{ker}}
  215. \def\lg{\qopname\relax{no}{lg}}
  216. \def\lim{\qopname\relax n{lim}}
  217. \def\liminf{\qopname\relax n{lim\,inf}}
  218. \def\limsup{\qopname\relax n{lim\,sup}}
  219. \def\ln{\qopname\relax{no}{ln}}
  220. \def\log{\qopname\relax{no}{log}}
  221. \def\max{\qopname\relax n{max}}
  222. \def\min{\qopname\relax n{min}}
  223. \def\Pr{\qopname\relax n{Pr}}
  224. \def\projlim{\qopname\relax n{proj\,lim}}
  225. \def\sec{\qopname\relax{no}{sec}}
  226. \def\sin{\qopname\relax{no}{sin}}
  227. \def\sinh{\qopname\relax{no}{sinh}}
  228. \def\sup{\qopname\relax n{sup}}
  229. \def\tan{\qopname\relax{no}{tan}}
  230. \def\tanh{\qopname\relax{no}{tanh}}
  231. \def\operator@font{\mathgroup\symoperators}
  232. \def\operatornamewithlimits{\operatorname*}
  233. \def\varlim@#1#2{\mathop{\vtop{\ialign{##\crcr
  234.  \hfil$#1\m@th\operator@font lim$\hfil\crcr
  235.  \noalign{\nointerlineskip\kern\ex@}#2#1\crcr
  236.  \noalign{\nointerlineskip\kern-\ex@}\crcr}}}}
  237. \def\varinjlim{\mathpalette\varlim@\rightarrowfill@}
  238. \def\varprojlim{\mathpalette\varlim@\leftarrowfill@}
  239. \def\varliminf{\mathpalette\varliminf@{}}
  240. \def\varliminf@#1{\mathop{\@@underline{\vrule\@depth.2\ex@\@width\z@
  241.    \hbox{$#1\m@th\operator@font lim$}}}}
  242. \def\varlimsup{\mathpalette\varlimsup@{}}
  243. \def\varlimsup@#1{\mathop{\@@overline
  244.   {\hbox{$#1\m@th\operator@font lim$}}}}
  245. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  246. \def\numberwithin#1#2{\@ifundefined{c@#1}{\@nocounterr{#1}}{%
  247.   \@ifundefined{c@#2}{\@nocnterr{#2}}{%
  248.   \@addtoreset{#1}{#2}%
  249.   \toks@\expandafter\expandafter\expandafter{\csname the#1\endcsname}%
  250.   \expandafter\xdef\csname the#1\endcsname
  251.     {\expandafter\noexpand\csname the#2\endcsname
  252.      .\the\toks@}}}}
  253. \def\eqref#1{\textup{\tagform@{\ref{#1}}}}
  254. \def\bmod{\mskip-\medmuskip\mkern5mu\mathbin
  255.   {\operator@font mod}\penalty900
  256.   \mkern5mu\mskip-\medmuskip}
  257. \def\pod#1{\allowbreak\if@display\mkern18mu\else\mkern8mu\fi(#1)}
  258. \def\pmod#1{\pod{{\operator@font mod}\mkern6mu#1}}
  259. \def\mod#1{\allowbreak\if@display\mkern18mu
  260.   \else\mkern12mu\fi{\operator@font mod}\,\,#1}
  261. \newcommand{\cfrac}[3][c]{{\displaystyle\frac{%
  262.   \strut\ifx r#1\hfill\fi#2\ifx l#1\hfill\fi}{#3}}%
  263.   \kern-\nulldelimiterspace}
  264. \def\lcfrac{\@subst@obsolete\lcfrac{\cfrac[l]}}
  265. \def\rcfrac{\@subst@obsolete\rcfrac{\cfrac[r]}}
  266. \def\overset#1#2{\binrel@{#2}%
  267.   \binrel@@{\mathop{\kern\z@#2}\limits^{#1}}}
  268. \def\underset#1#2{\binrel@{#2}%
  269.   \binrel@@{\mathop{\kern\z@#2}\limits_{#1}}}
  270. \def\sideset#1#2#3{%
  271.   \setbox\z@\hbox{$\displaystyle{\vphantom{#3}}#1{#3}\m@th$}%
  272.   \setbox\tw@\hbox{$\displaystyle{#3}#2\m@th$}%
  273.   \hskip\wd\z@\hskip-\wd\tw@\mathop{\hskip\wd\tw@\hskip-\wd\z@
  274.   {\vphantom{#3}}#1{#3}#2}}
  275. \renewcommand{\smash}[2][tb]{%
  276.   \def\smash@{#1}%
  277.   \ifmmode\expandafter\mathpalette\expandafter\mathsm@sh\else
  278.         \expandafter\makesm@sh\fi{#2}}
  279. \def\finsm@sh{\def\mb@t{\ht\z@\z@}\def\mb@b{\dp\z@\z@}%
  280.   \def\mb@tb{\mb@t\mb@b}%
  281.   {\csname mb@\smash@\endcsname}%
  282.   \leavevmode\boxz@}
  283. \def\rightarrowfill@#1{\m@th\setboxz@h{$#1-$}\ht\z@\z@
  284.   $#1\copy\z@\mkern-6mu\cleaders
  285.   \hbox{$#1\mkern-2mu\box\z@\mkern-2mu$}\hfill
  286.   \mkern-6mu\mathord\rightarrow$}
  287. \def\leftarrowfill@#1{\m@th\setboxz@h{$#1-$}\ht\z@\z@
  288.   $#1\mathord\leftarrow\mkern-6mu\cleaders
  289.   \hbox{$#1\mkern-2mu\copy\z@\mkern-2mu$}\hfill
  290.   \mkern-6mu\box\z@$}
  291. \def\leftrightarrowfill@#1{\m@th\setboxz@h{$#1-$}\ht\z@\z@
  292.   $#1\mathord\leftarrow\mkern-6mu\cleaders
  293.   \hbox{$#1\mkern-2mu\box\z@\mkern-2mu$}\hfill
  294.   \mkern-6mu\mathord\rightarrow$}
  295. \def\overarrow@#1#2#3{\vbox{\ialign{##\crcr#1#2\crcr
  296.  \noalign{\kern-\ex@\nointerlineskip}$\m@th\hfil#2#3\hfil$\crcr}}}
  297. \def\overrightarrow{\mathpalette{\overarrow@\rightarrowfill@}}
  298. \def\overleftarrow{\mathpalette{\overarrow@\leftarrowfill@}}
  299. \def\overleftrightarrow{\mathpalette{\overarrow@\leftrightarrowfill@}}
  300. \def\underarrow@#1#2#3{%
  301.  \vtop{\ialign{##\crcr$\m@th\hfil#2#3\hfil$\crcr
  302.  \noalign{\nointerlineskip\kern-.5\ex@}#1#2\crcr}}}
  303. \def\underrightarrow{\mathpalette{\underarrow@\rightarrowfill@}}
  304. \def\underleftarrow{\mathpalette{\underarrow@\leftarrowfill@}}
  305. \def\underleftrightarrow{\mathpalette{\underarrow@\leftrightarrowfill@}}
  306. \let\ifgtest@\iffalse                              % initial value
  307. \def\gtest@true{\global\let\ifgtest@\iftrue}
  308. \def\gtest@false{\global\let\ifgtest@\iffalse}
  309. \let\DOTSI\relax
  310. \let\DOTSB\relax
  311. \let\DOTSX\relax
  312. {\uccode`7=`\\ \uccode`8=`m \uccode`9=`a \uccode`0=`t \uccode`!=`h
  313.  \uppercase{%
  314.   \gdef\math@#1#2#3#4#5#6\math@{\gtest@false\ifx 7#1\ifx 8#2%
  315.   \ifx 9#3\ifx 0#4\ifx !#5\xdef\meaning@{#6}\gtest@true
  316.   \fi\fi\fi\fi\fi}}}
  317. {\uccode`7=`c \uccode`8=`h \uccode`9=`\"
  318.  \uppercase{\gdef\mathch@#1#2#3#4#5#6\mathch@{\gtest@false
  319.   \ifx 7#1\ifx 8#2\ifx 9#5\gtest@true\xdef\meaning@{9#6}\fi\fi\fi}}}
  320. \newcount\classnum@
  321. \def\getmathch@#1.#2\getmathch@{\classnum@#1 \divide\classnum@4096
  322.  \ifcase\number\classnum@\or\or\gdef\thedots@{\dotsb@}\or
  323.  \gdef\thedots@{\dotsb@}\fi}
  324. {\uccode`4=`b \uccode`5=`i \uccode`6=`n
  325.  \uppercase{\gdef\mathbin@#1#2#3{\relaxnext@
  326.   \def\nextii@##1\mathbin@{\ifx\@sptoken\@let@token\gtest@true\fi}%
  327.   \gtest@false\DN@##1\mathbin@{}%
  328.  \ifx 4#1\ifx 5#2\ifx 6#3\DN@{\FN@\nextii@}\fi\fi\fi\next@}}}
  329. {\uccode`4=`r \uccode`5=`e \uccode`6=`l
  330.  \uppercase{\gdef\mathrel@#1#2#3{\relaxnext@
  331.   \def\nextii@##1\mathrel@{\ifx\@sptoken\@let@token\gtest@true\fi}%
  332.  \gtest@false\DN@##1\mathrel@{}%
  333.  \ifx 4#1\ifx 5#2\ifx 6#3\DN@{\FN@\nextii@}\fi\fi\fi\next@}}}
  334. {\uccode`5=`m \uccode`6=`a \uccode`7=`c
  335.  \uppercase{\gdef\macro@#1#2#3#4\macro@{\gtest@false
  336.   \ifx 5#1\ifx 6#2\ifx 7#3\gtest@true
  337.   \xdef\meaning@{\macro@@#4\macro@@}\fi\fi\fi}}}
  338. \def\macro@@#1->#2\macro@@{#2}
  339. \newcount\DOTSCASE@
  340. {\uccode`6=`\\ \uccode`7=`D \uccode`8=`O \uccode`9=`T \uccode`0=`S
  341.  \uppercase{\gdef\DOTS@#1#2#3#4#5{\gtest@false\DN@##1\DOTS@{}%
  342.   \ifx 6#1\ifx 7#2\ifx 8#3\ifx 9#4\ifx 0#5\let\next@\DOTS@@
  343.   \fi\fi\fi\fi\fi
  344.   \next@}}}
  345. {\uccode`3=`B \uccode`4=`I \uccode`5=`X
  346.  \uppercase{\gdef\DOTS@@#1{\relaxnext@
  347.   \def\nextii@##1\DOTS@{\ifx\@sptoken\@let@token\gtest@true\fi}%
  348.   \DN@{\FN@\nextii@}%
  349.   \ifx 3#1\global\DOTSCASE@\z@\else
  350.   \ifx 4#1\global\DOTSCASE@\@ne\else
  351.   \ifx 5#1\global\DOTSCASE@\tw@\else\DN@##1\DOTS@{}%
  352.   \fi\fi\fi\next@}}}
  353. {\uccode`5=`\\ \uccode`6=`n \uccode`7=`o \uccode`8=`t
  354.  \uppercase{\gdef\not@#1#2#3#4{\relaxnext@
  355.   \def\nextii@##1\not@{\ifx\@sptoken\@let@token\gtest@true\fi}%
  356.  \gtest@false\DN@##1\not@{}%
  357.  \ifx 5#1\ifx 6#2\ifx 7#3\ifx 8#4\DN@{\FN@\nextii@}\fi\fi\fi
  358.  \fi\next@}}}
  359. \def\keybin@{\gtest@true
  360.  \ifx\@let@token+\else\ifx\@let@token=\else\ifx\@let@token<\else\ifx\@let@token>\else
  361.  \ifx\@let@token-\else
  362.  \ifx\@let@token*\else\ifx\@let@token:\else\gtest@false\fi\fi\fi\fi\fi\fi\fi}
  363. \@ifundefined{@ldots}{\def\@ldots{\mathellipsis}}{}
  364. \DeclareRobustCommand{\dots}{\relax
  365.   \csname\ifmmode m\else t\fi dots@\endcsname}
  366. \def\tdots@{\leavevmode\unskip\relaxnext@
  367.  \DN@{$\m@th\@ldots\,
  368.    \ifx\@let@token,\,$\else\ifx\@let@token.\,$\else\ifx\@let@token;\,$\else
  369.    \ifx\@let@token:\,$\else
  370.    \ifx\@let@token?\,$\else\ifx\@let@token!\,$\else$ \fi\fi\fi\fi\fi\fi}%
  371.  \ \FN@\next@}
  372. \def\mdots@{\FN@\mdots@@}
  373. \def\mdots@@{\gdef\thedots@{\dotso@}%
  374.  \ifx\@let@token\boldsymbol\gdef\thedots@\boldsymbol{\boldsymboldots@}\else
  375.  \ifx,\@let@token\gdef\thedots@{\dotsc}%
  376.  \else\ifx\not\@let@token\gdef\thedots@{\dotsb@}%
  377.  \else\keybin@
  378.  \ifgtest@\gdef\thedots@{\dotsb@}%
  379.  \else\xdef\meaning@{\meaning\@let@token..........}\xdef\meaning@@{\meaning@}%
  380.   \expandafter\math@\meaning@\math@
  381.   \ifgtest@
  382.    \expandafter\mathch@\meaning@\mathch@
  383.    \ifgtest@\expandafter\getmathch@\meaning@\getmathch@\fi
  384.   \else\expandafter\macro@\meaning@@\macro@
  385.   \ifgtest@
  386.    \expandafter\not@\meaning@\not@\ifgtest@\gdef\thedots@{\dotsb@}%
  387.   \else\expandafter\DOTS@\meaning@\DOTS@
  388.   \ifgtest@
  389.    \ifcase\number\DOTSCASE@\gdef\thedots@{\dotsb@}%
  390.     \or\gdef\thedots@{\dotsi}\else\fi
  391.   \else\expandafter\math@\meaning@\math@
  392.   \ifgtest@\expandafter\mathbin@\meaning@\mathbin@
  393.   \ifgtest@\gdef\thedots@{\dotsb@}%
  394.   \else\expandafter\mathrel@\meaning@\mathrel@
  395.   \ifgtest@\gdef\thedots@{\dotsb@}%
  396.   \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  397.  \thedots@}
  398. \def\boldsymboldots@#1{\bold@true\let\@let@token=#1\let\delayed@=#1\mdots@@
  399.  \boldsymbol#1\bold@false}
  400. \def\@cdots{\mathinner{\cdotp\cdotp\cdotp}}
  401. \def\dotsi{\!\@cdots}
  402. \let\dotsb@\@cdots
  403. \def\rightdelim@{\gtest@true
  404.  \ifx\@let@token)\else
  405.  \ifx\@let@token]\else
  406.  \ifx\@let@token\rbrack\else
  407.  \ifx\@let@token\}\else
  408.  \ifx\@let@token\rbrace\else
  409.  \ifx\@let@token\rangle\else
  410.  \ifx\@let@token\rceil\else
  411.  \ifx\@let@token\rfloor\else
  412.  \ifx\@let@token\rgroup\else
  413.  \ifx\@let@token\rmoustache\else
  414.  \ifx\@let@token\right\else
  415.  \ifx\@let@token\bigr\else
  416.  \ifx\@let@token\biggr\else
  417.  \ifx\@let@token\Bigr\else
  418.  \ifx\@let@token\Biggr\else\gtest@false
  419.  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
  420. \def\extra@{%
  421.  \rightdelim@\ifgtest@
  422.  \else\ifx\@let@token$\gtest@true
  423.  \else\xdef\meaning@{\meaning\@let@token..........}%
  424.  \expandafter\macro@\meaning@\macro@\ifgtest@
  425.  \expandafter\DOTS@\meaning@\DOTS@
  426.  \ifgtest@
  427.  \ifnum\DOTSCASE@=\tw@\gtest@true\else\gtest@false
  428.  \fi\fi\fi\fi\fi}
  429. \newif\ifbold@
  430. \def\dotso@{\relaxnext@
  431.  \ifbold@
  432.   \let\@let@token\delayed@
  433.   \def\nextii@{\extra@\@ldots\ifgtest@\,\fi}%
  434.  \else
  435.   \def\nextii@{\DN@{\extra@\@ldots\ifgtest@\,\fi}\FN@\next@}%
  436.  \fi
  437.  \nextii@}
  438. \def\extrap@#1{%
  439.  \DN@{#1\,}%
  440.  \ifx\@let@token,\else
  441.  \ifx\@let@token;\else
  442.  \ifx\@let@token.\else\extra@
  443.  \ifgtest@\else
  444.  \let\next@#1\fi\fi\fi\fi\next@}
  445. \DeclareRobustCommand{\ldots}{\relax
  446.   \ifmmode \DN@{\extrap@\@ldots}%
  447.   \else \let\next@\tdots@\fi
  448.   \FN@\next@}
  449. \DeclareRobustCommand{\cdots}{\DN@{\extrap@\@cdots}\FN@\next@}
  450. \let\dotso\ldots
  451. \let\dotsb\cdots
  452. \let\dotsm\dotsb
  453. \DeclareRobustCommand{\dotsc}{%
  454.   \DN@{\ifx\@let@token;\@ldots\,%
  455.        \else \ifx\@let@token.\@ldots\,%
  456.        \else \extra@\@ldots \ifgtest@\,\fi
  457.        \fi\fi}%
  458.   \FN@\next@}
  459. \def\longrightarrow{\DOTSB\relbar\joinrel\rightarrow}
  460. \def\Longrightarrow{\DOTSB\Relbar\joinrel\Rightarrow}
  461. \def\longleftarrow{\DOTSB\leftarrow\joinrel\relbar}
  462. \def\Longleftarrow{\DOTSB\Leftarrow\joinrel\Relbar}
  463. \def\longleftrightarrow{\DOTSB\leftarrow\joinrel\rightarrow}
  464. \def\Longleftrightarrow{\DOTSB\Leftarrow\joinrel\Rightarrow}
  465. \def\mapsto{\DOTSB\mapstochar\rightarrow}
  466. \def\longmapsto{\DOTSB\mapstochar\longrightarrow}
  467. \def\hookrightarrow{\DOTSB\lhook\joinrel\rightarrow}
  468. \def\hookleftarrow{\DOTSB\leftarrow\joinrel\rhook}
  469. \def\doteq{\DOTSB\buildrel\textstyle.\over=}
  470. \def\iff{\DOTSB\;\Longleftrightarrow\;}
  471. \mathchardef\@tempa=\string"7000
  472. \ifx\@tempa\Gamma
  473.   \DeclareMathSymbol{\Gamma}{\mathord}{operators}{"00}
  474.   \DeclareMathSymbol{\Delta}{\mathord}{operators}{"01}
  475.   \DeclareMathSymbol{\Theta}{\mathord}{operators}{"02}
  476.   \DeclareMathSymbol{\Lambda}{\mathord}{operators}{"03}
  477.   \DeclareMathSymbol{\Xi}{\mathord}{operators}{"04}
  478.   \DeclareMathSymbol{\Pi}{\mathord}{operators}{"05}
  479.   \DeclareMathSymbol{\Sigma}{\mathord}{operators}{"06}
  480.   \DeclareMathSymbol{\Upsilon}{\mathord}{operators}{"07}
  481.   \DeclareMathSymbol{\Phi}{\mathord}{operators}{"08}
  482.   \DeclareMathSymbol{\Psi}{\mathord}{operators}{"09}
  483.   \DeclareMathSymbol{\Omega}{\mathord}{operators}{"0A}
  484.   \DeclareMathSymbol{\varGamma}{\mathord}{letters}{"00}
  485.   \DeclareMathSymbol{\varDelta}{\mathord}{letters}{"01}
  486.   \DeclareMathSymbol{\varTheta}{\mathord}{letters}{"02}
  487.   \DeclareMathSymbol{\varLambda}{\mathord}{letters}{"03}
  488.   \DeclareMathSymbol{\varXi}{\mathord}{letters}{"04}
  489.   \DeclareMathSymbol{\varPi}{\mathord}{letters}{"05}
  490.   \DeclareMathSymbol{\varSigma}{\mathord}{letters}{"06}
  491.   \DeclareMathSymbol{\varUpsilon}{\mathord}{letters}{"07}
  492.   \DeclareMathSymbol{\varPhi}{\mathord}{letters}{"08}
  493.   \DeclareMathSymbol{\varPsi}{\mathord}{letters}{"09}
  494.   \DeclareMathSymbol{\varOmega}{\mathord}{letters}{"0A}
  495. \fi
  496. \def\accentclass@{7}
  497. \def\noaccents@{\def\accentclass@{0}}
  498. \DeclareFontEncoding{OML}{}{\noaccents@}
  499. \DeclareFontEncoding{OMS}{}{\noaccents@}
  500. \edef\@tempa#1#2{\def#1{\mathaccent\string"\noexpand\accentclass@#2 }}
  501. \@tempa\hat{05E}
  502. \@tempa\check{014}
  503. \@tempa\tilde{07E}
  504. \@tempa\acute{013}
  505. \@tempa\grave{012}
  506. \@tempa\dot{05F}
  507. \@tempa\ddot{07F}
  508. \@tempa\breve{015}
  509. \@tempa\bar{016}
  510. \newcount\skewcharcount@
  511. \newcount\familycount@
  512. \def\theskewchar@{\familycount@\@ne
  513.  \global\skewcharcount@\the\skewchar\textfont\@ne
  514.  \ifnum\mathgroup>\m@ne\ifnum\mathgroup<16
  515.   \global\familycount@\the\mathgroup\relax
  516.   \global\skewcharcount@\the\skewchar\textfont\the\mathgroup\relax\fi\fi
  517.  \ifnum\skewcharcount@>\m@ne
  518.   \ifnum\skewcharcount@<128
  519.   \multiply\familycount@256
  520.   \global\advance\skewcharcount@\familycount@
  521.   \global\advance\skewcharcount@28672
  522.   \mathchar\skewcharcount@\else
  523.   \global\skewcharcount@\m@ne\fi\else
  524.  \global\skewcharcount@\m@ne\fi}
  525. \newcount\pointcount@
  526. \def\getpoints@#1.#2\getpoints@{\pointcount@#1 }
  527. \newdimen\accentdimen@
  528. \newcount\accentmu@
  529. \def\dimentomu@{\multiply\accentdimen@ 100
  530.  \expandafter\getpoints@\the\accentdimen@\getpoints@
  531.  \multiply\pointcount@18
  532.  \divide\pointcount@\@m
  533.  \global\accentmu@\pointcount@}
  534.  
  535. \def\mathaccent@#1#2{\ifnum\mathgroup=\m@ne\xdef\thefam@{1}\else
  536.  \xdef\thefam@{\the\mathgroup}\fi
  537.  \accentdimen@\z@
  538.  \setboxz@h{\unbracefonts@$\m@th\mathgroup\thefam@\relax#2$}%
  539.  \ifdim\accentdimen@=\z@\DN@{\mathaccent#1{#2}}%
  540.   \setbox\@ne\hbox{\unbracefonts@
  541.     $\m@th\mathgroup\thefam@\relax#2\theskewchar@$}
  542.   \setbox\tw@\hbox{$\m@th\ifnum\skewcharcount@=\m@ne\else
  543.    \mathchar\skewcharcount@\fi$}%
  544.   \global\accentdimen@\wd\@ne\global\advance\accentdimen@-\wdz@
  545.   \global\advance\accentdimen@-\wd\tw@
  546.   \global\multiply\accentdimen@\tw@
  547.   \dimentomu@\global\advance\accentmu@\@ne
  548.  \else\DN@{{\mathaccent#1{#2\mkern\accentmu@ mu}%
  549.     \mkern-\accentmu@ mu}{}}\fi
  550.  \next@}
  551. \def\unbracefonts@{\let\math@bgroup\@empty\let\math@egroup\@empty}
  552. \begingroup \catcode`\"=12
  553. \def\@tempa#1#2{\gdef#1{\RIfM@\DN@{\mathaccent@{"\accentclass@#2 }}%
  554.   \else\DN@{\nonmatherr@{#1}}\fi\next@}}
  555. \@tempa\Hat{05E}
  556. \@tempa\Check{014}
  557. \@tempa\Tilde{07E}
  558. \@tempa\Acute{013}
  559. \@tempa\Grave{012}
  560. \@tempa\Dot{05F}
  561. \@tempa\Ddot{07F}
  562. \@tempa\Breve{015}
  563. \@tempa\Bar{016}
  564. \gdef\Vec{\RIfM@\DN@{\mathaccent@{"017E }}\else
  565.  \DN@{\nonmatherr@\Vec}\fi\next@}
  566. \endgroup
  567. \begingroup \catcode`\"=12
  568. \gdef\@@sqrt#1{\radical"270370 {#1}}
  569. \endgroup
  570. \@saveprimitive\overline\@@overline
  571. \def\overline#1{\@@overline{#1}}
  572. \def\boxed#1{\fbox{\m@th$\displaystyle#1$}}
  573. \def\setb@ck{\iffirstchoice@\global\advance\c@equation\m@ne\fi}
  574. \newcount\dspbrk@lvl
  575. \dspbrk@lvl=-1
  576. \interdisplaylinepenalty\@M
  577. \def\allowdisplaybreaks{%
  578.   \new@ifnextchar[\allowdspbrks@{\allowdspbrks@[4]}}
  579. \def\allowdspbrks@[#1]{%
  580.   \interdisplaylinepenalty\getdsp@pen{#1}}
  581. \def\getdsp@pen#1{%
  582.   \ifcase #1\relax \@M
  583.     \or 9999
  584.     \or 6999
  585.     \or 2999
  586.     \or \z@\fi}
  587. \def\displaybreak{\PackageError{amstex}{\Invalid@@\displaybreak}\@eha}
  588.  
  589. \def\displaybreak@{%
  590.   \def\displaybreak{\new@ifnextchar[\dspbrk@{\dspbrk@[4]}}}
  591.  
  592. \def\dspbrk@[#1]{\global\dspbrk@lvl #1\relax}
  593. \def\math@cr{{\ifnum0=`}\fi
  594.   \new@ifstar{\global\@eqpen\@M\math@cr@}%
  595.           {\global\@eqpen
  596.              \ifnum\dspbrk@lvl <\z@ \interdisplaylinepenalty
  597.               \else -\@getpen\dspbrk@lvl \fi
  598.            \math@cr@}}
  599. \def\math@cr@{\new@ifnextchar[\math@cr@@{\math@cr@@[\z@]}}
  600. \def\math@cr@@[#1]{\ifnum0=`{\fi}\math@cr@@@
  601.   \noalign{\vskip#1\relax}}
  602. \def\Let@{\let\\\math@cr}
  603. \def\restore@math@cr{\def\math@cr@@@{\cr}}
  604. \restore@math@cr
  605. \def\intertext{\PackageError{amstex}{\Invalid@@\intertext}\@eha}
  606. \def\intertext@{\def\intertext##1{\noalign{%
  607.   \penalty\postdisplaypenalty\vskip\belowdisplayskip
  608.   \vbox{\normalbaselines\noindent##1}%
  609.   \penalty\predisplaypenalty\vskip\abovedisplayskip}}}
  610. \newhelp\tag@help
  611.   {tag cannot be used at this point.\space
  612.    If you don't understand why^^Jyou should consult
  613.    the documentation.^^JBut don't worry: just continue, and I'll
  614.    forget what happened.}
  615. \def\gobble@tag{\new@ifstar\@gobble\@gobble}
  616. \def\invalid@tag#1{\PackageError{amstex}{#1}{\the\tag@help}\gobble@tag}
  617. \def\dft@tag{\invalid@tag{\string\tag\space not allowed here}}
  618. \def\default@tag{\let\tag\dft@tag}
  619. \default@tag
  620. \def\maketag@@{\new@ifstar\maketag@@@\tagform@}
  621. \def\maketag@@@#1{\hbox{\m@th\normalfont#1}}
  622. \def\tagform@#1{\maketag@@@{(\ignorespaces#1\unskip)}}
  623. \def\thetag{\leavevmode\tagform@}
  624. \def\make@df@tag{\new@ifstar\make@df@tag@@\make@df@tag@@@}
  625. \def\make@df@tag@@#1{%
  626.   \def\@currentlabel{#1}%
  627.   \gdef\df@tag{\maketag@@@{#1}}}
  628. \def\make@df@tag@@@#1{\@seteqlabel{#1}\gdef\df@tag{\tagform@{#1}}}
  629. \def\@seteqlabel#1{\toks@\@xp{\p@equation{#1}}%
  630.   \edef\@currentlabel{\the\toks@}}
  631. \def\notag{\nonumber}
  632. \iftagsleft@
  633. \def\@eqnnum{\hbox to1sp{}\rlap{\normalfont
  634.     \hskip -\displaywidth\tagform@\theequation}}
  635. \fi
  636.  
  637. \let\@adjusttag\@empty
  638.  
  639. \def\adjusttag#1{\skip@#1\relax\gdef\@adjusttag{#1}}
  640.  
  641. \def\@movetag{%
  642.     \ifx\@adjusttag\@empty \else
  643.         \vskip\@adjusttag\relax
  644.         \global\let\@adjusttag\@empty
  645.     \fi
  646. }
  647. \def\multilimits@{\bgroup
  648.   \Let@
  649.   \restore@math@cr
  650.   \default@tag
  651.  \baselineskip\fontdimen10 \scriptfont\tw@
  652.  \advance\baselineskip\fontdimen12 \scriptfont\tw@
  653.  \lineskip\thr@@\fontdimen8 \scriptfont\thr@@
  654.  \lineskiplimit\lineskip
  655.  \vbox\bgroup\ialign\bgroup\hfil$\m@th\scriptstyle{##}$\hfil\crcr}
  656. \def\Sb{_\multilimits@}
  657. \def\Sp{^\multilimits@}
  658. \def\endSb{\crcr\egroup\egroup\egroup}
  659. \let\endSp=\endSb
  660. \def\smallmatrix{\null\,\vcenter\bgroup
  661.  \Let@\restore@math@cr\default@tag
  662.  \baselineskip6\ex@ \lineskip1.5\ex@ \lineskiplimit\lineskip
  663.  \ialign\bgroup\hfil$\m@th\scriptstyle{##}$\hfil&&\thickspace\hfil
  664.  $\m@th\scriptstyle{##}$\hfil\crcr}
  665. \def\endsmallmatrix{\crcr\egroup\egroup\,}
  666. \newcount\c@MaxMatrixCols
  667. \c@MaxMatrixCols=10
  668.  
  669. \def\matrix{\hskip -\arraycolsep\array{*\c@MaxMatrixCols c}}
  670. \def\endmatrix{\endarray \hskip -\arraycolsep}
  671. \@ifundefined{prepnext@tok}{%
  672.   \def\@array[#1]#2{%
  673.     \setbox\@arstrutbox\hbox{\vrule\@height\arraystretch\ht\strutbox
  674.        \@depth\arraystretch\dp\strutbox \@width\z@}%
  675.     \@mkpream{#2}\edef\@preamble{\ialign \noexpand\@halignto
  676.     \bgroup \tabskip\z@ \@arstrut \@preamble \tabskip\z@ \cr}%
  677.     \let\@startpbox\@@startpbox \let\@endpbox\@@endpbox
  678.     \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi
  679.     \bgroup \let\par\@empty
  680.     \let\@sharp##\let\protect\relax
  681.     \lineskip\z@\baselineskip\z@\@preamble}%
  682. \begingroup \lccode`\~=`\@ \catcode`\~=\active % just to be sure!
  683. \lowercase{%
  684. \gdef\@xexpast#1*#2#3#4\@@{\begingroup
  685.   \def~{@}\edef\reserved@a{#1}\@tempcnta#2\relax
  686.   \ifnum\@tempcnta >\z@
  687.     \@whilenum\@tempcnta >\z@\do
  688.       {\edef\reserved@a{\reserved@a#3}\advance\@tempcnta \m@ne}%
  689.     \let\reserved@b\@xexpast
  690.   \else \let\reserved@b\@xexnoop\fi
  691.   \expandafter\reserved@b \reserved@a #4\@@
  692.   \expandafter\endgroup
  693.   \expandafter\def\expandafter\reserved@a\expandafter{\reserved@a}%
  694.   \let\@tempa\reserved@a
  695. }% End of \@xexpast
  696. }% End of \lowercase
  697. \endgroup
  698. }{}% End of \@ifundefined test.
  699. \def\pmatrix{\left(\matrix}
  700. \def\endpmatrix{\endmatrix\right)}
  701. \def\bmatrix{\left[\matrix}
  702. \def\endbmatrix{\endmatrix\right]}
  703. \def\vmatrix{\left|\matrix}
  704. \def\endvmatrix{\endmatrix\right|}
  705. \def\Vmatrix{\left\|\matrix}
  706. \def\endVmatrix{\endmatrix\right\|}
  707. \let\hdots\@ldots
  708. \def\hdotsfor#1{\if\noexpand#1[\expandafter\shdots@for\else
  709.                 \hdots@for\@ne{#1}\fi}
  710. \newmuskip\dotsspace@
  711. \def\shdots@for#1]{\hdots@for{#1}}
  712. \def\hdots@for#1#2{\multicolumn{#2}c%
  713.   {\m@th\dotsspace@1.5mu\mkern-#1\dotsspace@
  714.    \xleaders\hbox{$\m@th\mkern#1\dotsspace@.\mkern#1\dotsspace@$}%
  715.            \hfill
  716.    \mkern-#1\dotsspace@}%
  717.    }
  718. \def\cases{\left\{\def\arraystretch{1.2}\hskip-\arraycolsep
  719.   \array{l@{\quad}l}}
  720. \def\endcases{\endarray\hskip-\arraycolsep\right.}
  721. \newif\ifinany@
  722. \newif\ifinalign@
  723. \newif\ifingather@
  724. \newcount\and@
  725. \newif\iftag@
  726. \newhelp\andhelp@
  727. {An extra & here is so disastrous that you should probably exit^^J
  728. and fix things up.}
  729. \newif\ifst@rred
  730. \newtoks\@envbody
  731. \def\addto@envbody#1{\@envbody\expandafter{\the\@envbody#1}}
  732. \def\collect@body#1{%
  733.   \@envbody{}%
  734.   \def\process@envbody{%
  735.     \expandafter#1\expandafter{\the\@envbody}}%
  736.   \expandafter\let\csname\@currenvir\endcsname\collect@@body
  737.   \csname\@currenvir\endcsname}
  738. \def\collect@@body#1\end#2{%
  739.   \def\@tempa{#2}%
  740.   \ifx\@tempa\@currenvir
  741.     \addto@envbody{#1}%
  742.     \expandafter\edef\csname\@currenvir\endcsname
  743.       {\noexpand\process@envbody\noexpand\end{\@tempa}}%
  744.   \else
  745.     \addto@envbody{#1\end{#2}}%
  746.   \fi
  747.   \csname\@currenvir\endcsname}
  748. \def\aligned{\RIfM@\else\nonmatherr@{\begin{aligned}}\fi
  749.   \null\,\new@ifnextchar[{\aligned@}{\aligned@[c]}}
  750. \def\aligned@[#1]{%
  751.   \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi
  752.   \bgroup
  753.    \Let@\restore@math@cr
  754.    \default@tag
  755.    \ifinany@\else\openup\jot\fi
  756.    \ialign\bgroup\hfil\strut@$\m@th\displaystyle{##}$&%
  757.     $\m@th\displaystyle{{}##}$\hfil\crcr}
  758. \def\endaligned{\crcr\egroup\egroup}
  759. \newtoks\hashtoks@
  760. \hashtoks@{#}
  761. \newcount\atcount@
  762. \def\doat@#1{\toks@{\hfil\strut@$\m@th
  763.   \displaystyle{\the\hashtoks@}$&$\m@th\displaystyle
  764.   {{}\the\hashtoks@}$\hfil}%
  765.  \atcount@#1\relax\advance\atcount@\m@ne
  766.  \loop\ifnum\atcount@>\z@\toks@\expandafter{\the\toks@&\hfil$\m@th
  767.   \displaystyle{\the\hashtoks@}$&$\m@th
  768.   \displaystyle{{}\the\hashtoks@}$\hfil}\advance
  769.  \atcount@\m@ne\repeat
  770.  \xdef\preamble@{\the\toks@}\xdef\preamble@@{\preamble@}}
  771. \def\alignedat#1{\null\,\vcenter\bgroup\doat@{#1}\Let@
  772.  \restore@math@cr\default@tag
  773.  \ifinany@\else\openup\jot\fi\ialign\bgroup\span\preamble@@\crcr}
  774. \let\endalignedat =\endaligned
  775. \def\gathered{\RIfM@\else\nonmatherr@{\begin{gathered}}\fi
  776.  \null\,\vcenter\bgroup\Let@\restore@math@cr
  777.  \ifinany@\else\openup\jot\fi\ialign
  778.  \bgroup\hfil\strut@$\m@th\displaystyle{##}$\hfil\crcr}
  779.  
  780. \let\endgathered =\endaligned
  781. \def\tag@in@align{\relax
  782.   \iftag@\DN@{\invalid@tag{Multiple \string\tag}}\else
  783.    \global\tag@true
  784.    \if@eqnsw\global\@eqnswfalse\fi
  785.    \let\next@\make@df@tag\fi
  786.   \next@}
  787. \def\math@cr@@@align{%
  788.   \if@eqnsw\global\tag@true\fi
  789.   \iftag@
  790.    \ifcase\and@
  791.     \DN@{&&}\else
  792.     \DN@{&}\fi\else
  793.     \let\next@\relax\fi
  794.   \next@
  795.   \relax
  796.   \if@eqnsw\tagform@\theequation\stepcounter{equation}\else
  797.   \iftag@\df@tag\fi\fi
  798.   \global\@eqnswtrue\cr}
  799. \def\Tag@{\relax\iftag@\else\firstchoice@true
  800.   \PackageError{amstex}{%
  801.   Extra & on this line%
  802.   }{\the\andhelp@% "An extra & here is disastrous"
  803. }\fi}
  804. \newdimen\lwidth@
  805. \newdimen\rwidth@
  806. \newdimen\maxlwidth@
  807. \newdimen\maxrwidth@
  808. \newdimen\totwidth@
  809. \def\measure@#1{\lwidth@\z@\rwidth@\z@\maxlwidth@\z@\maxrwidth@\z@
  810.  \global\and@\z@
  811.  \setbox\@ne\vbox{%
  812.    \everycr{\noalign{\global\tag@false\global\and@\z@}}\Let@
  813.    \let\tag\gobble@tag
  814.    \let\notag\@empty \let\nonumber\@empty
  815.    \firstchoice@false
  816.     \halign{\setboxz@h{$\m@th\displaystyle{\@lign##}$}%
  817.      \global\lwidth@\wdz@
  818.      \ifdim\lwidth@>\maxlwidth@\global\maxlwidth@\lwidth@\fi
  819.      \global\advance\and@\@ne
  820.      &\setboxz@h{$\m@th\displaystyle{{}\@lign##}$}%
  821.      \global\rwidth@\wdz@
  822.      \ifdim\rwidth@>\maxrwidth@\global\maxrwidth@\rwidth@\fi
  823.      \global\advance\and@\@ne
  824.      &\Tag@\@gobble{##}\crcr#1\crcr}}%
  825.  \totwidth@\maxlwidth@\advance\totwidth@\maxrwidth@}
  826. \def\displ@y{\global\dt@ptrue\openup\jot\m@th
  827.   \everycr{\noalign{\ifdt@p \global\dt@pfalse
  828.       \vskip-\lineskiplimit \vskip\normallineskiplimit
  829.       \else \penalty\@eqpen \fi}}}
  830. \def\displ@y@{\global\dt@ptrue\openup\jot
  831.   \everycr{\noalign{\global\tag@false
  832.                    \global\and@\z@
  833.                    \global\dspbrk@lvl\m@ne
  834.                    \ifdt@p\global\dt@pfalse
  835.       \vskip-\lineskiplimit\vskip\normallineskiplimit\else
  836.       \penalty\@eqpen\fi}}}
  837. \def\black@#1{\noalign{\ifdim#1>\displaywidth
  838.  \dimen@\prevdepth\nointerlineskip
  839.  \vskip-\ht\strutbox@\vskip-\dp\strutbox@
  840.  \vbox{\noindent\hbox to#1{\strut@\hfill}}%
  841.  \prevdepth\dimen@
  842.  \fi}}
  843. \def\align{\ifingather@
  844.   {\ifnum0=`}\fi
  845.   \DN@{\@nameuse{align (in \string\gather)}}%
  846.   \else \ifmmode\nomath@env
  847.     \DN@{\let\endalign\relax\@gobble}\else
  848.   $$\stepcounter{equation}%
  849.   \st@rredfalse\let\next@\align@\fi\fi
  850.  \collect@body\next@}
  851. \@namedef{align*}{\ifingather@
  852.   {\ifnum0=`}\fi
  853.   \DN@{\@nameuse{align* (in \string\gather)}}\else
  854.    \ifmmode\nomath@env
  855.     \DN@{\@namedef{endalign*}{}\@gobble}\else
  856.    $$\st@rredtrue
  857.   \let\next@\align@\fi\fi
  858.  \collect@body\next@}
  859. \newdimen\lineht@
  860. \def\align@{\inalign@true\inany@true
  861.  \displaybreak@\intertext@
  862.  \let\math@cr@@@\math@cr@@@align
  863.  \let\tag\tag@in@align
  864.  \global\and@\z@\global\dspbrk@lvl\m@ne
  865.  \iftagsleft@\DN@{\@nameuse{align }}\else
  866.   \DN@{\@nameuse{align \space}}\fi\next@}
  867. \@namedef{align }#1{%
  868.     \measure@{#1}%
  869.     \global\and@\z@
  870.     \global\dspbrk@lvl\m@ne
  871.     \if@fleqn %%*F
  872.         \advance\totwidth@\@mathmargin %%*F
  873.     \fi %%*F
  874.     \ifdim\totwidth@>\displaywidth
  875.         \let\displaywidth@\totwidth@
  876.     \else
  877.         \let\displaywidth@\displaywidth
  878.     \fi
  879.     \ifingather@
  880.         \everycr{%
  881.             \noalign{%
  882.                 \global\and@\z@
  883.                 \global\dspbrk@lvl\m@ne
  884.             }%
  885.         }%
  886.     \else
  887.         \displ@y@
  888.     \fi
  889.     \Let@
  890.     \ifst@rred\else\@seteqlabel\theequation\fi
  891.     \tabskip\@mathmargin %%*F
  892.     \dimen@\displaywidth %%*F
  893.     \if@fleqn %%*F
  894.         \ifingather@ %%*F
  895.             \tabskip\z@skip %%*F
  896.             \advance\dimen@-\@mathmargin %%*F
  897.         \fi %%*F
  898.     \fi %%*F
  899.     \halign to\dimen@\bgroup %%*F
  900.         \ifst@rred\nonumber\fi
  901.         \hfil
  902.         \strut@
  903.         \setboxz@h{\global\tag@false$\m@th\displaystyle{\@lign##}$}%
  904.         \global\lwidth@\wdz@
  905.         \global\lineht@\ht\z@
  906.         \boxz@
  907.         \global\advance\and@\@ne
  908.         \tabskip\z@skip
  909.        &\setboxz@h{$\m@th\displaystyle{{}\@lign##}$}%
  910.         \global\rwidth@\wdz@
  911.         \ifdim\ht\z@>\lineht@
  912.             \global\lineht@\ht\z@
  913.         \fi
  914.         \boxz@
  915.         \hfil
  916.         \global\advance\and@\@ne
  917.         \tabskip\@centering
  918.        &\kern-\displaywidth@
  919.         \setboxz@h{\@lign\strut@{##}}%
  920.         \if@fleqn %%*F
  921.             \dimen@\@mathmargin %%*F
  922.             \advance\dimen@\maxlwidth@ %%*F
  923.             \advance\dimen@-\lwidth@ %%*F
  924.         \else %%*F
  925.             \dimen@\displaywidth
  926.             \advance\dimen@-\totwidth@
  927.             \divide\dimen@\tw@
  928.             \advance\dimen@\maxlwidth@
  929.             \advance\dimen@-\lwidth@
  930.         \fi %%*F
  931.         \ifdim\dimen@<\tw@\wdz@
  932.             \rlap{\vbox{\normalbaselines\boxz@\vbox to\lineht@{}}}%
  933.         \else
  934.             \rlap{\boxz@}%
  935.         \fi
  936.         \tabskip\displaywidth@
  937.         \crcr
  938.         #1%
  939. }
  940. \@namedef{align \space}#1{%
  941.     \measure@{#1}%
  942.     \if@fleqn %%*F
  943.         \advance\totwidth@\@mathmargin %%*F
  944.     \fi %%*F
  945.     \global\and@\z@
  946.     \global\dspbrk@lvl\m@ne
  947.     \ifingather@
  948.         \everycr{\noalign{\global\and@\z@\global\dspbrk@lvl\m@ne}}%
  949.     \else
  950.         \displ@y@
  951.     \fi
  952.     \Let@
  953.     \ifst@rred\else\@seteqlabel\theequation\fi
  954.     \tabskip\@mathmargin %%*F
  955.     \dimen@\displaywidth %%*F
  956.     \if@fleqn %%*
  957.         \ifingather@ %%*F
  958.             \tabskip\z@skip %%*F
  959.             \advance\dimen@-\@mathmargin %%*F
  960.         \fi %%*F
  961.     \fi %%*F
  962.      \halign to\dimen@\bgroup %%*F
  963.         \ifst@rred\nonumber\fi
  964.         \hfil
  965.         \strut@
  966.         \setboxz@h{\global\tag@false$\m@th\displaystyle{\@lign##}$}%
  967.         \global\lwidth@\wdz@\boxz@
  968.         \global\advance\and@\@ne
  969.         \tabskip\z@skip
  970.        &\setboxz@h{$\m@th\displaystyle{{}\@lign##}$}%
  971.         \global\rwidth@\wdz@
  972.         \boxz@
  973.         \hfill
  974.         \global\advance\and@\@ne
  975.         \tabskip\@centering
  976.        &\setboxz@h{\@lign\strut@{##}}%
  977.         \dimen@\displaywidth
  978.         \advance\dimen@-\totwidth@
  979.         \divide\dimen@\tw@
  980.         \advance\dimen@\maxrwidth@
  981.         \advance\dimen@-\rwidth@
  982.         \ifdim\dimen@<\tw@\wdz@
  983.             \llap{\vtop{\@movetag\normalbaselines\null\boxz@}}%%*T
  984.         \else
  985.             \llap{\boxz@}%
  986.         \fi
  987.         \tabskip\z@skip
  988.         \crcr#1%
  989. }
  990. \def\endalign{\math@cr@@@align
  991.   \black@\totwidth@
  992.   \egroup$$\global\@ignoretrue\setb@ck}
  993.  
  994. \@namedef{endalign*}{\math@cr@@@align\black@\totwidth@
  995.   \egroup$$\global\@ignoretrue}
  996. \@namedef{align (in \string\gather)}{%
  997.   \ifst@rred\stepcounter{equation}\fi
  998.   \def\endalign{\@nameuse{endalign (in \string\gather)}\ifnum0=`{\fi}}%
  999.   \vcenter\bgroup\st@rredfalse
  1000.     \collect@body\align@}
  1001. \@namedef{endalign (in \string\gather)}{%
  1002.   \math@cr@@@align\black@\totwidth@
  1003.   \egroup\egroup
  1004.   \ifst@rred\setb@ck\fi% this ifst@rred is set by the enclosing gather
  1005.   \global\tag@false\global\@eqnswfalse}
  1006. \@namedef{align* (in \string\gather)}{%
  1007.   \@namedef{endalign*}{\@nameuse{endalign* (in \string\gather)}%
  1008.                        \ifnum0=`{\fi}}%
  1009.   \vcenter\bgroup\st@rredtrue
  1010.     \collect@body\align@}
  1011. \@namedef{endalign* (in \string\gather)}{%
  1012.   \math@cr@@@align\black@\totwidth@\egroup\egroup
  1013.   \global\tag@false\global\@eqnswfalse}
  1014. \newif\ifxat@
  1015. \def\alignat#1{%
  1016.  \ifmmode\nomath@env\DN@{\let\endalignat\relax\@gobble}\else$$%
  1017.  \st@rredfalse\stepcounter{equation}\@seteqlabel\theequation
  1018.  \DN@{\@nameuse{alignat }#1}\fi
  1019.  \collect@body\next@}
  1020. \@namedef{alignat*}#1{%
  1021.  \ifmmode\nomath@env\DN@{\@namedef{endalignat*}{}\@gobble}\else$$%
  1022.  \st@rredtrue
  1023.  \DN@{\@nameuse{alignat }#1}\fi
  1024.  \collect@body\next@}
  1025. \newif\ifmeasuring@
  1026. \newbox\savealignat@
  1027. \def\math@cr@@@alignat{%
  1028.   \if@eqnsw\global\tag@true\fi
  1029.   \iftag@
  1030.    \multiply\count@\tw@
  1031.    \xdef\next@{}\loop\ifnum\count@>\and@\xdef\next@{&\next@}%
  1032.     \advance\count@\m@ne\repeat\else
  1033.    \let\next@\relax\fi
  1034.   \next@
  1035.   \relax
  1036.   \if@eqnsw\tagform@\theequation\stepcounter{equation}\else
  1037.   \iftag@\df@tag\fi\fi
  1038.   \global\@eqnswtrue\cr}%
  1039. \@namedef{alignat }#1#2{%
  1040.     \inany@true
  1041.     \xat@false
  1042.     \let\tag\tag@in@align
  1043.     \def\math@cr@@@{\count@#1\relax \math@cr@@@alignat}%
  1044.     \displaybreak@
  1045.     \intertext@
  1046.     \displ@y@
  1047.     \ifst@rred
  1048.         \global\@eqnswfalse
  1049.     \else
  1050.         \global\@eqnswtrue
  1051.     \fi
  1052.     \measuring@true
  1053.     \setbox\savealignat@\hbox{%
  1054.         $\m@th\displaystyle\Let@
  1055.         \attag@{#1}%
  1056.         \vbox{\firstchoice@false\halign{\span\preamble@@\crcr#2\crcr}}$%
  1057.     }%
  1058.     \measuring@false
  1059.     \Let@
  1060.     \attag@{#1}%
  1061.     \tabskip\@mathmargin %%*F
  1062.     \halign to\displaywidth\bgroup
  1063.         \span\preamble@@\crcr
  1064.         #2%
  1065. }
  1066. \def\endalignat{\math@cr@@@\black@{\wd\savealignat@}%
  1067.      \egroup\setb@ck$$\global\@ignoretrue}
  1068. \@namedef{endalignat*}{\math@cr@@@\black@{\wd\savealignat@}\egroup
  1069.   $$\global\@ignoretrue}
  1070. \def\xalignat#1{%
  1071.  \ifmmode\nomath@env\DN@{\let\endxalignat\relax\@gobble}\else$$%
  1072.  \st@rredfalse\stepcounter{equation}\@seteqlabel\theequation
  1073.  \DN@{\@nameuse{xalignat }#1}\fi
  1074.  \collect@body\next@}
  1075. \@namedef{xalignat*}#1{%
  1076.  \ifmmode\nomath@env\DN@{\@namedef{endxalignat*}{}\@gobble}\else$$%
  1077.  \st@rredtrue
  1078.  \DN@{\@nameuse{xalignat }#1}\fi
  1079.  \collect@body\next@}
  1080. \let\endxalignat=\endalignat
  1081.  
  1082. \expandafter\let\csname endxalignat*\expandafter
  1083.   \endcsname\csname endalignat*\endcsname
  1084. \@namedef{xalignat }#1#2{%
  1085.     \inany@true
  1086.     \xat@true
  1087.     \let\tag\tag@in@align
  1088.     \def\math@cr@@@{\count@#1\relax\math@cr@@@alignat}%
  1089.     \displaybreak@
  1090.     \intertext@
  1091.     \displ@y@
  1092.     \measuring@true
  1093.     \setbox\savealignat@\hbox{%
  1094.         $\m@th\displaystyle\Let@
  1095.         \attag@{#1}%
  1096.         \vbox{%
  1097.             \firstchoice@false
  1098.             \halign{\span\preamble@@\crcr#2\crcr}%
  1099.         }%
  1100.         $%
  1101.     }%
  1102.     \measuring@false
  1103.     \Let@
  1104.     \attag@{#1}%
  1105.     \tabskip\@mathmargin %%*F
  1106.     \halign to\displaywidth\bgroup
  1107.         \span\preamble@@\crcr#2%
  1108. }
  1109. \def\attag@#1{%
  1110.  \let\TAG@\Tag@\let\Tag@0%
  1111.  \ifmeasuring@\def\llap@##1{\setboxz@h{##1}\hbox to\tw@\wdz@{}}%
  1112.   \def\rlap@##1{\setboxz@h{##1}\hbox to\tw@\wdz@{}}\else
  1113.   \let\llap@\llap\let\rlap@\rlap\fi
  1114.  \toks@{\hfil\strut@$\m@th\displaystyle{\@lign\the\hashtoks@}$%
  1115.   \tabskip\z@skip
  1116.   \global\advance\and@\@ne
  1117.   &$\m@th\displaystyle{{}\@lign\the\hashtoks@}$\hfil
  1118.   \ifxat@\tabskip\@centering\fi\global\advance\and@\@ne}%
  1119.  \iftagsleft@
  1120.   \@temptokena{\tabskip\@centering&\Tag@\kern-\displaywidth
  1121.    \rlap@{\@lign
  1122.      \the\hashtoks@
  1123.     }%
  1124.    \global\advance\and@\@ne\tabskip\displaywidth}\else
  1125.   \@temptokena{\tabskip\@centering&\Tag@\llap@{\@lign
  1126.    \the\hashtoks@
  1127.   }\global\advance\and@\@ne\tabskip\z@skip}\fi
  1128.  \atcount@#1\relax\advance\atcount@\m@ne
  1129.  \loop\ifnum\atcount@>\z@
  1130.  \toks@\expandafter{\the\toks@&\hfil$\m@th\displaystyle{\@lign
  1131.   \the\hashtoks@}$\global\advance\and@\@ne
  1132.   \tabskip\z@skip
  1133.   &$\m@th\displaystyle{{}\@lign\the\hashtoks@}$\hfil\ifxat@
  1134.   \tabskip\@centering\fi\global\advance\and@\@ne}\advance\atcount@\m@ne
  1135.  \repeat
  1136.  \xdef\preamble@{\the\toks@\the\@temptokena}%
  1137.  \xdef\preamble@@{\ifst@rred\noexpand\nonumber\fi\preamble@}%
  1138.  \let\Tag@\TAG@}
  1139. \def\xxalignat#1{%
  1140.  \ifmmode\nomath@env\DN@{\let\endxxalignat\relax\@gobble}\else$$%
  1141.  \DN@{\@nameuse{xxalignat }#1}\fi
  1142.  \collect@body\next@}
  1143. \@namedef{xxalignat }#1#2{\inany@true
  1144.  \displaybreak@\intertext@
  1145.  \displ@y\setbox\savealignat@\hbox{$\m@th\displaystyle\Let@
  1146.  \xxattag@{#1}%
  1147.  \vbox{\firstchoice@false\halign{\span\preamble@@\crcr#2\crcr}}$}%
  1148.  \Let@\xxattag@{#1}\tabskip\z@skip\halign to\displaywidth\bgroup
  1149.   \span\preamble@@\crcr#2}
  1150. \expandafter\let\expandafter\endxxalignat\csname endxalignat*\endcsname
  1151. \def\xxattag@#1{\toks@{\tabskip\z@skip\hfil\strut@
  1152.  $\m@th\displaystyle{\the\hashtoks@}$&%
  1153.  $\m@th\displaystyle{{}\the\hashtoks@}$\hfil\tabskip\@centering&}%
  1154.  \atcount@#1\relax\advance\atcount@\m@ne\loop\ifnum\atcount@>\z@
  1155.  \toks@
  1156.   \expandafter
  1157.    {\the\toks@&\hfil$\m@th\displaystyle{\the\hashtoks@}$%
  1158.   \tabskip\z@skip&$\m@th\displaystyle{{}\the\hashtoks@}$\hfil
  1159.   \tabskip\@centering}\advance\atcount@\m@ne\repeat
  1160.  \xdef\preamble@{\the\toks@\tabskip\z@skip}\xdef\preamble@@{\preamble@}}
  1161. \newdimen\gwidth@
  1162. \newdimen\gmaxwidth@
  1163. \def\gmeasure@#1{\gwidth@\z@\gmaxwidth@\z@\setbox\@ne\vbox{\Let@
  1164.  \firstchoice@false\let\tag\gobble@tag
  1165.  \halign{\setboxz@h{$\m@th\displaystyle{##}$}\global\gwidth@\wdz@
  1166.  \ifdim\gwidth@>\gmaxwidth@\global\gmaxwidth@\gwidth@\fi
  1167.  &\@gobble{##}\crcr#1\crcr}}}
  1168. \def\math@cr@@@gather{%
  1169.   \if@eqnsw\global\tag@true\fi
  1170.   \iftag@
  1171.     \DN@{&\relax \if@eqnsw
  1172.                     \tagform@\theequation \stepcounter{equation}%
  1173.                  \else\iftag@\df@tag\fi\fi}%
  1174.   \else
  1175.     \expandafter\@gobble\fi
  1176.   \next@
  1177.   \global\@eqnswtrue\cr}
  1178. \def\gather{%
  1179.  \ifmmode\nomath@env\DN@{\let\endgather\relax\@gobble}\else $$%
  1180.   \ingather@true\inany@true
  1181.   \stepcounter{equation}%
  1182.   \let\tag\tag@in@align\st@rredfalse
  1183.   \displaybreak@\intertext@
  1184.   \displ@y
  1185.   \Let@\@seteqlabel\theequation
  1186.   \let\math@cr@@@\math@cr@@@gather
  1187.   \iftagsleft@\DN@{\@nameuse{gather }}\else
  1188.    \DN@{\@nameuse{gather \space}}\fi\fi
  1189.  \collect@body\next@}
  1190. \@namedef{gather*}{%
  1191.  \ifmmode\nomath@env\DN@{\@namedef{endgather*}{}\@gobble}\else $$%
  1192.   \ingather@true\inany@true
  1193.   \let\tag\tag@in@align\st@rredtrue
  1194.   \displaybreak@\intertext@
  1195.   \displ@y\Let@
  1196.   \let\math@cr@@@\math@cr@@@gather
  1197.   \iftagsleft@\DN@{\@nameuse{gather }}\else
  1198.    \DN@{\@nameuse{gather \space}}\fi\fi
  1199.  \collect@body\next@}
  1200. \newdimen\glineht@
  1201. \@namedef{gather \space}#1{%
  1202.     \gmeasure@{#1}%
  1203.     \if@fleqn %%*F
  1204.         \advance\gmaxwidth@\@mathmargin %%*F
  1205.     \fi %%*F
  1206.     \global\dt@ptrue
  1207.     \tabskip\@mathmargin %%*F
  1208.     \halign to\displaywidth\bgroup
  1209.         \ifst@rred\nonumber\else\global\@eqnswtrue\fi
  1210.         \if@fleqn\else\hfil\fi %%*F
  1211.         \strut@
  1212.         \setboxz@h{\global\tag@false$\m@th\displaystyle{##}$}%
  1213.         \global\gwidth@\wdz@\boxz@
  1214.         \hfil
  1215.         \tabskip\@centering %%*F
  1216.        &\setboxz@h{\strut@{##}}%
  1217.         \dimen@\displaywidth
  1218.         \advance\dimen@-\gwidth@
  1219.         \if@fleqn %%*F
  1220.             \advance\dimen@-\@mathmargin %%*F
  1221.         \else %%*F
  1222.             \divide\dimen@\tw@ %%*B
  1223.         \fi %%*F
  1224.         \ifdim\dimen@<\tw@\wdz@ %%*
  1225.             \llap{\vtop{\@movetag\normalbaselines\null\boxz@}}%%*T %%*
  1226.         \else
  1227.             \llap{\boxz@}% %%*
  1228.         \fi
  1229.         \tabskip\z@skip
  1230.         \crcr
  1231.         #1%
  1232. }
  1233. \def\endgather{\math@cr@@@
  1234.   \black@\gmaxwidth@\egroup $$\setb@ck\global\@ignoretrue}
  1235.  
  1236. \@namedef{endgather*}{\math@cr@@@
  1237.   \black@\gmaxwidth@\egroup $$\global\@ignoretrue}
  1238. \@namedef{gather }#1{%
  1239.     \gmeasure@{#1}%
  1240.     \global\dt@ptrue
  1241.     \if@fleqn %%*F
  1242.         \advance\gmaxwidth@\@mathmargin %%*F
  1243.     \fi %%*F
  1244.     \ifdim\gmaxwidth@>\displaywidth
  1245.         \let\gdisplaywidth@\gmaxwidth@
  1246.     \else
  1247.         \let\gdisplaywidth@\displaywidth
  1248.     \fi
  1249.     \tabskip\@mathmargin %%*F
  1250.     \halign to\displaywidth\bgroup
  1251.         \ifst@rred\nonumber\else\global\@eqnswtrue\fi
  1252.         \if@fleqn\else\hfil\fi %%*F
  1253.         \strut@
  1254.         \setboxz@h{\global\tag@false$\m@th\displaystyle{##}$}%
  1255.         \global\gwidth@\wdz@
  1256.         \global\glineht@\ht\z@
  1257.         \boxz@
  1258.         \hfil
  1259.         \tabskip\@centering %%*F
  1260.        &\kern-\gdisplaywidth@
  1261.         \setboxz@h{\strut@{##}}%
  1262.         \if@fleqn %%*F
  1263.             \dimen@\@mathmargin %%*F
  1264.         \else %%*F
  1265.             \dimen@\displaywidth
  1266.             \advance\dimen@-\gwidth@
  1267.             \divide\dimen@\tw@ %%*B
  1268.         \fi %%*F
  1269.         \ifdim\dimen@<\tw@\wdz@ %%*
  1270.             \rlap{\vbox{\normalbaselines\boxz@\vbox to\glineht@{}}}% %%*
  1271.         \else
  1272.             \rlap{\boxz@}% %%*
  1273.         \fi
  1274.         \tabskip\gdisplaywidth@
  1275.         \crcr
  1276.         #1%
  1277. }
  1278. \def\split{%
  1279.  \ifinany@\let\next@\insplit@\else
  1280.   \DN@{\PackageError{amstex}{\string\begin{split} is not allowed
  1281.     here.  Try the `aligned' environment.}\@ehb}\fi
  1282.  \next@}
  1283. \def\insplit@{\global\setbox\z@\vbox\bgroup
  1284.   \Let@ \restore@math@cr \default@tag % disallow use of \tag here
  1285.   \ialign\bgroup \hfil\strut@
  1286.    $\m@th\displaystyle{##}$&$\m@th\displaystyle{{}##}$\hfill\crcr}
  1287. \def\endsplit{\crcr\egroup\egroup
  1288.  \iftagsleft@\expandafter\lendsplit@\else
  1289.   \expandafter\rendsplit@\fi}
  1290. \def\rendsplit@{\global\setbox9 \vbox
  1291.  {\unvcopy\z@\global\setbox8 \lastbox\unskip}%
  1292.  \setbox\@ne\hbox{\unhcopy8 \unskip\global\setbox\tw@\lastbox
  1293.  \unskip\global\setbox\thr@@\lastbox}%
  1294.  \global\setbox7 \hbox{\unhbox\tw@\unskip}%
  1295.  \ifinalign@\ifctagsplit@
  1296.   \gdef\split@{\hbox to\wd\thr@@{}&
  1297.    \vcenter{\vbox{\moveleft\wd\thr@@\boxz@}}}%
  1298.  \else\gdef\split@{&\vbox{\moveleft\wd\thr@@\box9}\crcr
  1299.   \box\thr@@&\box7}\fi
  1300.  \else
  1301.   \ifctagsplit@\gdef\split@{\vcenter{\boxz@}}\else
  1302.   \gdef\split@{\box9\crcr\hbox{\box\thr@@\box7}}\fi
  1303.  \fi
  1304.  \aftergroup\split@}
  1305. \def\lendsplit@{\global\setbox9\vtop{\unvcopy\z@}%
  1306.  \setbox\@ne\vbox{\unvcopy\z@\global\setbox8\lastbox}%
  1307.  \setbox\@ne\hbox{\unhcopy8\unskip\setbox\tw@\lastbox
  1308.   \unskip\global\setbox\thr@@\lastbox}%
  1309.  \ifinalign@\ifctagsplit@
  1310.   \gdef\split@{\hbox to\wd\thr@@{}&
  1311.   \vcenter{\vbox{\moveleft\wd\thr@@\box9}}}%
  1312.   \else
  1313.   \gdef\split@{\hbox to\wd\thr@@{}&\vbox{\moveleft\wd\thr@@\box9}}\fi
  1314.  \else
  1315.   \ifctagsplit@\gdef\split@{\vcenter{\box9}}\else
  1316.   \gdef\split@{\box9}\fi
  1317.  \fi\aftergroup\split@}
  1318. \newdimen\multlinegap
  1319. \multlinegap10pt
  1320. \newdimen\multlinetaggap@
  1321. \multlinetaggap@10pt
  1322. \def\multline{%
  1323.  \ifmmode\nomath@env\DN@{\let\endmultline\relax\@gobble}%
  1324.  \else $$\DN@{\collect@body\multline@}\fi
  1325.  \st@rredfalse\@eqnswtrue \@seteqlabel\theequation
  1326.  \stepcounter{equation}\next@}
  1327. \@namedef{multline*}{%
  1328.  \ifmmode\nomath@env\DN@{\@namedef{endmultline*}{}\@gobble}%
  1329.  \else $$\DN@{\collect@body\multline@}\fi
  1330.  \st@rredtrue\@eqnswfalse \let\@currentlabel\@empty
  1331.  \next@}
  1332. \def\multline@{\inany@true\displaybreak@
  1333.  \global\tag@false
  1334.  \def\tag{\ifst@rred\else
  1335.    \global\advance\c@equation\m@ne\fi\tag@in@align}%
  1336.  \iftagsleft@
  1337.   \expandafter\lmultline@@\else
  1338.   \expandafter\rmultline@@\fi}
  1339. \newdimen\mwidth@
  1340. \def\rmmeasure@#1{%
  1341.  \def\shoveleft##1{##1}\def\shoveright##1{##1}%
  1342.  \setbox\@ne\vbox{\firstchoice@false\Let@\halign{\setboxz@h
  1343.   {$\m@th\@lign\displaystyle{}##$}\global\mwidth@\wdz@
  1344.   \crcr#1\crcr}}}
  1345. \newdimen\mlineht@
  1346. \newif\ifzerocr@
  1347. \newif\ifonecr@
  1348. \def\lmmeasure@#1{\global\zerocr@true\global\onecr@false
  1349.  \everycr{\noalign{\ifonecr@\global\onecr@false\fi
  1350.   \ifzerocr@\global\zerocr@false\global\onecr@true\fi}}%
  1351.   \def\shoveleft##1{##1}\def\shoveright##1{##1}%
  1352.  \setbox\@ne\vbox{\Let@\firstchoice@false\halign{\setboxz@h
  1353.   {$\m@th\@lign\displaystyle{}##$}\ifonecr@\global\mwidth@\wdz@
  1354.   \global\mlineht@\ht\z@\fi\crcr#1\crcr}}}
  1355. \newbox\mtagbox@
  1356. \newdimen\ltwidth@
  1357. \newdimen\rtwidth@
  1358. \def\lmultline@@#1{%
  1359.     \lmmeasure@{#1}%
  1360.     \setbox\mtagbox@\hbox{%
  1361.         \iftag@
  1362.             \df@tag
  1363.         \else
  1364.             \if@eqnsw
  1365.                 \global\tag@true
  1366.                 \tagform@\theequation
  1367.             \fi
  1368.         \fi
  1369.     }%
  1370.     \dimen@\mwidth@
  1371.     \advance\dimen@\wd\mtagbox@
  1372.     \advance\dimen@\multlinetaggap@
  1373.     \if@fleqn %%*F
  1374.         \advance\dimen@\@mathmargin %%*F
  1375.     \fi %%*F
  1376.     \ifdim\dimen@>\displaywidth
  1377.         \ltwidth@\z@
  1378.     \else
  1379.         \ltwidth@\wd\mtagbox@
  1380.     \fi
  1381.     \lmultline@@@#1
  1382. }
  1383. \def\lmultline@@@{%
  1384.     \displ@y
  1385.     \def\shoveright##1{##1\hfilneg\hskip\multlinegap}%
  1386.     \if@fleqn %%*F
  1387.         \def\shoveleft##1{##1}% %%*F
  1388.     \else %%*F
  1389.         \def\shoveleft##1{%
  1390.                 \setboxz@h{$\m@th\displaystyle{}##1$}%
  1391.                 \setbox\@ne\hbox{$\m@th\displaystyle##1$}%
  1392.                 \hfilneg
  1393.                 \iftag@
  1394.                     \ifdim\ltwidth@>\z@
  1395.                         \hskip\ltwidth@
  1396.                         \hskip\multlinetaggap@
  1397.                     \fi
  1398.                 \else
  1399.                     \hskip\multlinegap
  1400.                 \fi
  1401.                 \hskip.5\wd\@ne
  1402.                 \hskip-.5\wdz@##1%
  1403.         }%
  1404.     \fi %%*F
  1405.     \if@fleqn %%*F
  1406.         \tabskip\@mathmargin %%*F
  1407.     \else %%*F
  1408.         \tabskip\z@skip %%*
  1409.     \fi %%*F
  1410.     \totwidth@\displaywidth %%*F
  1411.     \if@fleqn %%*F
  1412.         \advance\totwidth@-\@mathmargin %%*F
  1413.     \fi %%*F
  1414.     \halign\bgroup
  1415.         \Let@
  1416.         \let\tag\gobble@tag
  1417.         \hbox to\totwidth@{% %%*F
  1418.             \strut@$\m@th\displaystyle
  1419.             \if@fleqn %%*F
  1420.                 \hskip 0pt plus 1000pt %%*F
  1421.             \else %%*F
  1422.                 \hfil
  1423.             \fi %%*F
  1424.             {}##\hfil$%
  1425.         }%
  1426.         \crcr
  1427.         \if@fleqn %%*F
  1428.             \hskip-\@mathmargin %%*F
  1429.         \else %%*F
  1430.             \hfilneg
  1431.         \fi %%*F
  1432.         \iftag@
  1433.             \ifdim\ltwidth@>\z@
  1434.                 \box\mtagbox@
  1435.                 \hskip\multlinetaggap@
  1436.             \else
  1437.                 \rlap{%
  1438.                     \vbox{%
  1439.                         \normalbaselines
  1440.                         \hbox{\strut@\box\mtagbox@}%
  1441.                         \vbox to\mlineht@{}%
  1442.                     }%
  1443.                 }%
  1444.                 \hskip\multlinegap %%*
  1445.             \fi
  1446.         \else
  1447.             \hskip\multlinegap
  1448.         \fi
  1449. }
  1450. \def\rmultline@@#1{%
  1451.     \rmmeasure@{#1}%
  1452.     \setbox\mtagbox@\hbox{%
  1453.         \iftag@
  1454.             \df@tag
  1455.         \else
  1456.             \if@eqnsw
  1457.                 \global\tag@true
  1458.                 \tagform@\theequation
  1459.             \fi
  1460.         \fi
  1461.     }%
  1462.     \dimen@\mwidth@
  1463.     \advance\dimen@\wd\mtagbox@
  1464.     \advance\dimen@\multlinetaggap@
  1465.     \if@fleqn %%*F
  1466.         \advance\dimen@\@mathmargin %%*F
  1467.     \fi %%*F
  1468.     \ifdim\dimen@>\displaywidth
  1469.         \rtwidth@\z@
  1470.     \else
  1471.         \rtwidth@\wd\mtagbox@
  1472.     \fi
  1473.     \rmultline@@@#1
  1474. }
  1475. \def\rmultline@@@{%
  1476.     \displ@y
  1477.     \def\shoveright##1{%
  1478.         ##1%
  1479.         \hfilneg
  1480.         \iftag@
  1481.             \ifdim\rtwidth@>\z@
  1482.                 \hskip\rtwidth@
  1483.                 \hskip\multlinetaggap@
  1484.             \fi
  1485.         \else
  1486.             \hskip\multlinegap
  1487.         \fi
  1488.     }%
  1489.     \if@fleqn %%*F
  1490.         \def\shoveleft##1{##1}% %%*F
  1491.     \else %%*F
  1492.         \def\shoveleft##1{%
  1493.             \setboxz@h{$\m@th\displaystyle{}##1$}%
  1494.             \setbox\@ne\hbox{$\m@th\displaystyle##1$}%
  1495.             \hfilneg
  1496.             \hskip\multlinegap
  1497.             \hskip.5\wd\@ne
  1498.             \hskip-.5\wdz@
  1499.             ##1%
  1500.         }%
  1501.     \fi %%*F
  1502.     \if@fleqn %%*F
  1503.         \tabskip\@mathmargin %%*F
  1504.     \else %%*F
  1505.         \tabskip\z@skip %%*
  1506.     \fi %%*F
  1507.     \totwidth@\displaywidth %%*F
  1508.     \if@fleqn %%*F
  1509.         \advance\totwidth@-\@mathmargin %%*F
  1510.     \fi %%*F
  1511.     \halign\bgroup
  1512.         \Let@
  1513.         \let\tag\gobble@tag
  1514.         \hbox to\totwidth@{%
  1515.             \strut@$\m@th\displaystyle
  1516.             \if@fleqn %%*F
  1517.                 \hskip 0pt plus 1000pt %%*F
  1518.             \else %%*F
  1519.                 \hfil
  1520.             \fi %%*F
  1521.             {}##\hfil$%
  1522.         }%
  1523.         \crcr
  1524.         \if@fleqn %%*F
  1525.             \hskip-\@mathmargin %%*F
  1526.         \else %%*F
  1527.             \hfilneg
  1528.         \fi %%*F
  1529.         \hskip\multlinegap
  1530. }
  1531. \def\endmultline{\iftagsleft@\expandafter\lendmultline@\else
  1532.   \expandafter\rendmultline@\fi\global\@ignoretrue}
  1533. \expandafter\let\csname endmultline*\endcsname=\endmultline
  1534. \def\lendmultline@{\hfilneg\hskip\multlinegap\crcr\egroup$$}
  1535. \def\rendmultline@{%
  1536.     \iftag@
  1537.         \ifdim\rtwidth@>\z@
  1538.             \hskip\multlinetaggap@
  1539.             \box\mtagbox@
  1540.         \else
  1541.             \hskip\multlinegap %%*
  1542.             \llap{%
  1543.                 \vtop{%
  1544.                     \@movetag %%*T
  1545.                     \normalbaselines\null\hbox{\strut@\box\mtagbox@}%
  1546.                 }%
  1547.             }%
  1548.         \fi
  1549.     \else
  1550.         \hskip\multlinegap
  1551.     \fi
  1552.     \hfilneg
  1553.     \crcr
  1554.     \egroup$$%
  1555. }
  1556. \expandafter\def
  1557.  \expandafter\@arrayparboxrestore
  1558.   \expandafter{\@arrayparboxrestore
  1559.                \inany@false\ingather@false\inalign@false
  1560.    \default@tag}
  1561. \def\equation{\gather\def\\{\PackageError{amstex}{\Invalid@@\\}\@eha}}
  1562. \def\endequation{\endgather}
  1563. \newenvironment{equation*}{%
  1564.   \equation
  1565. }{%
  1566.   \nonumber\endequation
  1567. }
  1568. \newcounter{parentequation}% Counter for ``parent equation''.
  1569. \newenvironment{subequations}[1]{%
  1570.   \refstepcounter{equation}%
  1571.   \begingroup % conservative approach
  1572.   \let\protect\noexpand
  1573.   \edef\@tempa{\def\noexpand\theparentequation{\theequation}}%
  1574.   \expandafter\endgroup\@tempa
  1575.   \setcounter{parentequation}{\value{equation}}%
  1576.   \setcounter{equation}{0}%
  1577.   \toks@\ifx#11{\arabic}%
  1578.     \else\ifx#1i{\roman}\else\ifx#1I{\Roman}%
  1579.     \else\ifx#1A{\Alph}\else\ifx#1a{\alph}%
  1580.     \else\ifx#1f{\fnsymbol}%
  1581.     \else{}\fi\fi\fi\fi\fi\fi
  1582.   \edef\@tempa{\the\toks@}%
  1583.   \ifx\@tempa\@empty \@badnumtype{#1}\toks@{\alph}\fi
  1584.   \edef\theequation{\noexpand\theparentequation
  1585.     \the\toks@{equation}}%
  1586.   \ignorespaces
  1587. }{%
  1588.   \setcounter{equation}{\value{parentequation}}%
  1589.   \global\@ignoretrue
  1590. }
  1591. \def\@badnumtype#1{%
  1592.   \PackageError{amstex}{Unknown number type: `#1'}\@ehc}
  1593. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1594. \def\atdef@#1{\expandafter\def\csname\space @\string#1\endcsname}
  1595. \begingroup \catcode`\@=\active
  1596. \gdef @{\Iat}
  1597. \endgroup
  1598. \DeclareRobustCommand{\Iat}{\FN@\at@}
  1599. \def\at@{\let\next@\at@@
  1600.  \ifcat\noexpand\@let@token a\else
  1601.  \ifcat\noexpand\@let@token0\else
  1602.  \ifcat\noexpand\@let@token\relax\else
  1603.  \let\@let@token@\at@@@\fi\fi\fi\next@}
  1604. \def\at@@#1{\expandafter
  1605.   \@ifundefined{ @\string#1}%
  1606.     {\DN@{\at@@@#1}}%
  1607.     {\DN@{\csname\space @\string#1\endcsname}}%
  1608.   \next@}%
  1609. \def\at@@@{\PackageError{amstex}{\Invalid@@ @}%
  1610.   {\the\athelp@}% "I'll assume you wanted @@"
  1611.   \char64\relax}
  1612. \newhelp\athelp@
  1613. {Only certain combinations beginning with @ make sense to me.^^J%
  1614. I'll assume you wanted @@ for a printed @.}
  1615. \atdef@ @{{\atchar}}% to define @@
  1616. \chardef\atchar=64
  1617. \def\makeatother{\catcode64=\active}
  1618. \def\@tempa#1#2#3#4#5#6{%
  1619.   {#1}{#2}\ifnum0#6=0{13}\@xp\@gobblefour
  1620.   \else{#3}\fi\@tempa{#4}{#5}{#6}}%
  1621. \xdef\@currnamestack{\@xp\@tempa\@currnamestack{}{}{0}}
  1622. {\def\@makeother{\noexpand\@makeother\noexpand}
  1623. \xdef\@sanitize{\@sanitize\@makeother\@}}
  1624. {\def\do{\noexpand\do\noexpand}
  1625. \xdef\dospecials{\dospecials\do\@}}
  1626. \atdef@,{\ifmmode\mskip.1\thinmuskip\else \nonmatherr@{@,}\fi}
  1627. \atdef@!{\RIfM@\mskip-.1\thinmuskip\else \nonmatherr@{@!}\fi}
  1628.  
  1629. \@ifpackageloaded{amscd}{%
  1630. }{%
  1631. \atdef@>#1>#2>{%
  1632.   \global\bigaw@\minaw@
  1633.   \setboxz@h{$\m@th\scriptstyle\;{#1}\;\;$}%
  1634.   \ifdim\wdz@>\bigaw@ \global\bigaw@\wdz@ \fi
  1635.   \@ifnotempty{#2}{\setbox\@ne\hbox{$\m@th\scriptstyle\;{#2}\;\;$}%
  1636.     \ifdim\wd\@ne>\bigaw@ \global\bigaw@\wd\@ne \fi}%
  1637.    \mathrel{\mathop{\hbox to\bigaw@{\rightarrowfill@\displaystyle}}%
  1638.      \limits^{#1}\@ifnotempty{#2}{_{#2}}}%
  1639. }% end of @>>>
  1640. \atdef@<#1<#2<{%
  1641.   \global\bigaw@\minaw@
  1642.   \setboxz@h{$\m@th\scriptstyle\;\;{#1}\;$}%
  1643.   \ifdim\wdz@>\bigaw@ \global\bigaw@\wdz@ \fi
  1644.   \@ifnotempty{#2}{\setbox\@ne\hbox{$\m@th\scriptstyle\;\;{#2}\;$}%
  1645.     \ifdim\wd\@ne>\bigaw@ \global\bigaw@\wd\@ne \fi}%
  1646.   \mathrel{\mathop{\hbox to\bigaw@{\leftarrowfill@\displaystyle}}%
  1647.       \limits^{#1}\@ifnotempty{#2}{_{#2}}}%
  1648. }% end of @<<<
  1649. }% end of @ifpackageloaded
  1650. \@ifundefined{minaw@}{\newdimen\minaw@}{}
  1651. \minaw@11.111pt
  1652. \@ifundefined{bigaw@}{\newdimen\bigaw@}{}
  1653. \atdef@-{\let\next-%%
  1654.   \DN@{\ifx\next-%%
  1655.     \def\next-{\setbox\z@\hbox{-}\unhbox\z@\FN@\next@}%%
  1656.     \expandafter\next \else\nobreak\fi}%%
  1657.   \next@-}%%
  1658. \def\leftroot{\PackageError{amstex}{\Invalid@@\leftroot}\@eha}
  1659. \def\uproot{\PackageError{amstex}{\Invalid@@\uproot}\@eha}
  1660. \newcount\uproot@
  1661. \newcount\leftroot@
  1662. \def\root{\relaxnext@
  1663.   \DN@{\ifx\@let@token\uproot\let\next@\nextii@\else
  1664.    \ifx\@let@token\leftroot\let\next@\nextiii@\else
  1665.    \let\next@\plainroot@\fi\fi\next@}%
  1666.   \def\nextii@\uproot##1{\uproot@##1\relax\FN@\nextiv@}%
  1667.   \def\nextiv@{\ifx\@let@token\@sptoken\DN@. {\FN@\nextv@}\else
  1668.    \DN@.{\FN@\nextv@}\fi\next@.}%
  1669.   \def\nextv@{\ifx\@let@token\leftroot\let\next@\nextvi@\else
  1670.    \let\next@\plainroot@\fi\next@}%
  1671.   \def\nextvi@\leftroot##1{\leftroot@##1\relax\plainroot@}%
  1672.    \def\nextiii@\leftroot##1{\leftroot@##1\relax\FN@\nextvii@}%
  1673.   \def\nextvii@{\ifx\@let@token\@sptoken
  1674.    \DN@. {\FN@\nextviii@}\else
  1675.    \DN@.{\FN@\nextviii@}\fi\next@.}%
  1676.   \def\nextviii@{\ifx\@let@token\uproot\let\next@\nextix@\else
  1677.    \let\next@\plainroot@\fi\next@}%
  1678.   \def\nextix@\uproot##1{\uproot@##1\relax\plainroot@}%
  1679.   \bgroup\uproot@\z@\leftroot@\z@\FN@\next@}
  1680. \def\plainroot@#1\of#2{\setbox\rootbox\hbox{%
  1681.  $\m@th\scriptscriptstyle{#1}$}%
  1682.  \mathchoice{\r@@t\displaystyle{#2}}{\r@@t\textstyle{#2}}
  1683.  {\r@@t\scriptstyle{#2}}{\r@@t\scriptscriptstyle{#2}}\egroup}
  1684. \def\r@@t#1#2{\setboxz@h{$\m@th#1\@@sqrt{#2}$}%
  1685.  \dimen@\ht\z@\advance\dimen@-\dp\z@
  1686.  \setbox\@ne\hbox{$\m@th#1\mskip\uproot@ mu$}%
  1687.  \advance\dimen@ by1.667\wd\@ne
  1688.  \mkern-\leftroot@ mu\mkern5mu\raise.6\dimen@\copy\rootbox
  1689.  \mkern-10mu\mkern\leftroot@ mu\boxz@}
  1690. \endinput
  1691. %% 
  1692. %% End of file `amstex.sty'.
  1693.